<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>测试Ajax</title>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#btn").click(function () {
                $.ajax({
                    url:"${pageContext.request.contextPath}/testJson",
                    type:"POST",
                    data:{},
                    dataType:"text",
                    success:function (obj) {
                        alert(obj);
                    }
                });
            });
        });
    </script>
</head>
<body>

<input type="button" value="点击" id="btn">

</body>
</html>
